package com.clt.ess.CABeen;

/**
 * 用于获取服务端随机数，并上传客户端随机数用于防重放攻击。
 * 调用前置条件
 * 第三方CA系统已经设置制章系统的证书及其根证书列表。
 * {
 * " taskCode ":"applyServiceRandom"，
 * " version ":"1.0"，
 * " applicantCert ":" base64编码的申请者签名证书"，
 * " randomA ":"1234567890123456"
 * }
 */
public class ApplyServiceRandomRequest {
    //业务类型 applyServiceRandom 必须
    private String taskCode;
    //协议版本号 1.0 必须
    private String version;
    //base64 编码的申请者签名证书 必须
    private String applicantCert;
    //客户端产生的随机数，长度为 16 个字节 必须
    private String randomA;


    public String getTaskCode() {
        return taskCode;
    }

    public void setTaskCode(String taskCode) {
        this.taskCode = taskCode;
    }

    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }

    public String getApplicantCert() {
        return applicantCert;
    }

    public void setApplicantCert(String applicantCert) {
        this.applicantCert = applicantCert;
    }

    public String getRandomA() {
        return randomA;
    }

    public void setRandomA(String randomA) {
        this.randomA = randomA;
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("{");
        sb.append("\"taskCode\":\"")
                .append(taskCode).append('\"');
        sb.append(",\"version\":\"")
                .append(version).append('\"');
        sb.append(",\"applicantCert\":\"")
                .append(applicantCert).append('\"');
        sb.append(",\"randomA\":\"")
                .append(randomA).append('\"');
        sb.append('}');
        return sb.toString();
    }
}
